class ZhangChunHuaJob
  include Sidekiq::Worker
  sidekiq_options :queue => :zhang_chun_hua, :retry => false

  def perform(alert_message)
    logger.info "开始执行"
    if %w[09:00].include?(Time.now.strftime("%H:%M"))
      content = <<~MD
        ** 早盘准备 **
        > [设置held](https://wyyzrx.com/admin/stocks?scope=is_held)
        > [设置FC](https://fcnext.console.aliyun.com/applications)
      MD
      Time.now.day > 15 ? (Robot.dd_must_do_ai content) : (Robot.dd_must_do content)
    end
    if %w[09:32 09:46 10:31 11:01 11:31 13:01 13:31 14:01 14:31 14:46].include?(Time.now.strftime("%H:%M"))
      content = <<~MD
        ** 板块看板 看上升多、资金流入多、涨幅靠前的板块 **
        > [板块看板](https://wyyzrx.com/admin/blockdashboard)
      MD
      Time.now.day > 15 ? (Robot.dd_must_do_ai content) : (Robot.dd_must_do content)
    end

    if %w[09:10 09:40 14:45].include?(Time.now.strftime("%H:%M"))
      content = <<~MD
        > [大盘看板](https://wyyzrx.com/admin/indexdashboard)
        > 9:00  看大盘开盘情况
        > 9:40  看涨跌家数比例
        > 14:45 看涨跌家数比例
      MD
      Time.now.day > 15 ? (Robot.dd_must_do_ai content) : (Robot.dd_must_do content)
      # Robot.zhangchunhua content
    end

    if %w[09:35 09:41 11:01 13:31 14:46].include?(Time.now.strftime("%H:%M"))
      content = <<~MD
        > [涨停看板](https://wyyzrx.com/admin/limitdashboard)
        > 涨停看板看情绪
        > 看连板数，看炸板数
      MD
      Time.now.day > 15 ? (Robot.dd_must_do_ai content) : (Robot.dd_must_do content)
    end

    if %w[9:35 9:40 11:00 13:30 14:45].include?(Time.now.strftime("%H:%M"))
      content = <<~MD
        > [自选看板](https://wyyzrx.com/admin/choicedashboard)
      MD
      Time.now.day > 15 ? (Robot.dd_must_do_ai content) : (Robot.dd_must_do content)
    end

    if %w[09:36 09:41 11:01 13:31 14:46].include?(Time.now.strftime("%H:%M"))
      content = <<~MD
        > [买点看板](https://wyyzrx.com/admin/stockbpdashboard)
      MD
      Time.now.day > 15 ? (Robot.dd_must_do_ai content) : (Robot.dd_must_do content)
    end

    if %w[09:45 14:31].include?(Time.now.strftime("%H:%M"))
      content = <<~MD
        ** 今日新晋板块 **
        > 分析板块是否有延续性上涨潜力，刚启动可以早上买入，下午观察是否继续走强。
        > 总结什么时候早上买，什么时候下午买
        > rake ths:choice_block['N']
      MD
      Time.now.day > 15 ? (Robot.dd_must_do_ai content) : (Robot.dd_must_do content)
    end
  end
end